import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import less from "less";
// 将所有的请求放置在getApi上面
import * as getApi from "@api/http";
// utils存element-ui的按需引入的文件
import utils from "./utils/utils";
import "./plugins/elements.js";
// 无限滚动条
import ElementUI from "element-ui";
import time from "./utils/time";
import dayjs from "dayjs";
import infiniteScroll from "vue-infinite-scroll";
// import getAwesomeSwiper from "vue-awesome-swiper/dist/exporter";

// 导入Swiper的核心类
import {
  Swiper as SwiperClass,
  Pagination,
  Mousewheel,
  Autoplay
} from "swiper/core";

// 引入样式
// 清除默认样式
import "./assets/css/normalize.css";
import "@assets/css/global.css";
import "@assets/fonts/font.css";
import "@assets/less/reset.less";
import "element-ui/lib/theme-chalk/index.css";
import "./assets/less/reset.css";
import "swiper/swiper-bundle.css";

// 注入原型, 全局实例均可以使用
Vue.prototype.dayjs = dayjs;
Vue.prototype.$time = time;
Vue.prototype.$ajax = getApi;
Vue.prototype.$utils = utils;

// 安装使用
Vue.use(less);
Vue.use(ElementUI);
SwiperClass.use([Pagination, Mousewheel, Autoplay]);
// Vue.use(getAwesomeSwiper(SwiperClass));
// 实现下拉加载数据, 无限下拉
Vue.use(infiniteScroll);

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
